package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 缓冲字符流      最常用的读写字符串的流
 * 是一对高级流，并且
 * BuffredWriter和BuffredReader
 * PrintWriter:按行写入数据
 */
public class PWDemo {
    public static void main(String[] args) throws IOException {
        PrintWriter pw=new PrintWriter("pw.txt");
        pw.println("吃");
        pw.println("peng");
        pw.println("杠");
        System.out.println("完毕");
        pw.close();

        /*
        FileOutputStream fos=new FileOutputStream("pw.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos,StandardCharsets.UTF_8);
        BufferedWriter bw=new BufferedWriter(osw);
        PrintWriter pw=new PrintWriter(bw);
        pw.print("吃，");
        pw.print("碰,");
        pw.print("杠");
        System.out.println("完毕");
        pw.close();

         */
    }
}
